
<template>
  <el-dialog
    title="补货详细"
    :visible.sync="deployShow"
    :before-close="closeIsShow"
  >
    <!-- 表单 -->
    <el-form ref="ruleForm" :model="ruleForm" status-icon :rules="rules" label-width="100px" class="demo-ruleForm">
      <el-form-item label="补货警戒线：" prop="value">
        <el-input-number v-model="ruleForm.value" controls-position="right" :min="1" :max="100" />
      </el-form-item>
    </el-form>
    <!-- 底部 -->
    <span slot="footer" class="dialog-footer">
      <el-button class="close" @click="closeIsShow">取 消</el-button>
      <el-button class="uncertainty " type="primary" @click="isOk">确 定</el-button>
    </span>
  </el-dialog>

</template>
<script>
import { setWorkValue } from '@/api'
export default {
  props: {
    deployShow: {
      type: Boolean,
      default: false
    },
    alertValue: {
      type: [String, Number],
      required: true
    }
  },
  data() {
    return {
      ruleForm: {
        value: this.alertValue
      },
      rules: {
        value: [
          { required: true, trigger: 'blur' }
        ]
      }
    }
  },
  methods: {
    closeIsShow() {
      this.$emit('update:deployShow', false)
    },
    async  isOk() {
      await setWorkValue(this.ruleForm.value)
      this.$emit('update:deployShow', false)
    }
  }
}
</script>
<style scoped lang='less'>
/deep/.el-dialog{
  position: relative;
  width: 630px;
  border-radius: 10px;
  height: 215px;
  .el-form {
    width: 630px;
    .el-form-item{
      height: 36px;
      display: flex;
      justify-content: start;
      align-items: center;
    }
  }
  .el-form-item__label{
    width: 140px!important;
  }
  .el-input-number{
    width: 396px!important;
    position: relative;
    left: -100px;
  }
  .el-input{
    width: 396px!important;
  }
  .el-input__inner{
    // position: relative;
    // left: -100px;
    padding-left: 15px;
    padding-right: 50px;
    border-color:#d8dde3;
    background-color: #fff;
    background-image: none;
    border-radius: 4px;
    border: 1px solid #d8dde3;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    color: #606266;
    display: inline-block;
    font-size: inherit;
    height: 40px;
    line-height: 40px;
    outline: none;
    padding: 0 15px;
    -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
    transition: border-color .2s cubic-bezier(.645,.045,.355,1);
    width: 396px!important;
  }
  .el-dialog__footer{
    padding: 0 20px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    .close{
      width: 80px!important;
      height: 36px;
      color: #655b56!important;
      background-color: #fbf4f0!important;
     &:hover{
      color: #655b56!important;
      background-color: #f3e7e1!important;
      }
     }
     .uncertainty{
      width: 80px!important;
      height: 36px;
      background: linear-gradient(135deg,#ff9743,#ff5e20)!important;
      border: none;
      &:hover{
       background: linear-gradient(135deg,#ff7d43,#db3602)!important
      }
     }
   }
  .el-dialog__header {
   border-radius: 10px;
   line-height: 22px;
   font-size: 16px!important;
   font-weight: 600!important;
   height: 52px;
   background-color: #fff!important;
   .el-dialog__title{
     color: #333!important;
   }
  }
   .el-dialog__close{
    color: #909399!important;
    &:before{
     color: #909399!important;
    }
   }
   .el-dialog__body{
    display: flex;
    height: 86px;
    padding: 20px 20px 30px 30px;

}

}

</style>
